package com.mega.fe.render.shaders;

import com.mojang.blaze3d.vertex.DefaultVertexFormat;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.client.renderer.ShaderInstance;
import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.client.event.RegisterShadersEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;

import java.io.IOException;

@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD)
public class ShaderInit {
    public static ShaderInstance RAIN;

    public static void setRAIN(ShaderInstance RAIN) {
        ShaderInit.RAIN = RAIN;
    }

    public static ShaderInstance getRAIN() {
        return RAIN;
    }

    @SubscribeEvent
    public static void register(RegisterShadersEvent event) {
        try {
            event.registerShader(new ShaderInstance(event.getResourceProvider(), new ResourceLocation("crest_selection_gui"), DefaultVertexFormat.POSITION_TEX), ShaderInit::setRAIN);
            //System.exit(0);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
